package easy;

public class Solution_1614 {
    public int maxDepth(String s) {
        char[] chars = s.toCharArray();
        int depth = 0, max = 0;
        for (char c : chars) {
            if (c == '(') {
                depth++;
                if (depth > max) {
                    max = depth;
                }
            } else if (c == ')') {
                depth--;
            }
        }
        return max;
    }

    public static void main(String[] args) {
        Solution_1614 model = new Solution_1614();
    }
}
